package concept.misc;

public class CustomThread extends Thread
{
	public CustomThread()
	{
		
	}
	
	public CustomThread(Runnable r, String name)
	{
		super(r, name);
	}
	
	private static class CustomRunnable implements Runnable
	{
		public void run()
		{
			System.out.println(Thread.currentThread().getName()+" Custom runable!");
		}
	}
	
	public void run()
	{
		super.run();
		try
		{
			sleep(100);
		}
		catch (InterruptedException e)
		{
		}
		System.out.println(Thread.currentThread().getName()+" Custom thread!");
	}
	
	public static void main(String[] args)
	{
		Runnable r = new CustomThread.CustomRunnable();
		
		CustomThread ct = new CustomThread(r, "MyThread");
		ct.start();
		
		Thread t = new Thread(r);
		t.start();
	}

}
